<template>
	<view class="check">
		<input type="text" value="" v-model="captcha" :placeholder="$t('idSafe.forgetDealP.inpCode')" />
		<button type="default" @click="end">{{$t('verifyphone.end')}}</button>
	</view>
</template>

<script>
	import api from '../../common/api.js'
	export default {
		data() {
			return {
				token:'',
				mobile:'',
				captcha:''
			}
		},
		methods: {
			end(){
				console.log(2693);
				this.$api.sendRequest({					url: api.CHANGEMobile,					data: {						mobile:this.mobile,
						captcha:this.captcha					},					success: res => {						console.log(res.data);
						if(res.data.code==0){
							uni.showToast({
								title:res.data.msg,
								icon:'none'
							})
						}else{
							uni.showToast({
								title:res.data.msg,
								icon:'none',
								success:res1=>{
								uni.navigateTo({
									url:'../login/login'
								})	
								}
							})
							
						}					}				});
				
				
			}
		},
		created() {
			uni.getStorage({
				key:'token',
				success:res=>{
					console.log(res.data);
					this.token=res.data
				}
			})
		},
		onLoad(res) {
			console.log(res.mobile);
			this.mobile=res.mobile
		}
	}
</script>

<style>
.check{
	height: 94.6vh;
	background-color: #F3F3F3;
}
input{
	padding-left: 40rpx;
	height: 100rpx;
	width: 100%;
	background-color: #FFFFFF;
	position: relative;
	top: 40rpx;
}
button{
	background-color: #0070f9;
	color: #FFFFFF;
	width: 86%;
	margin: auto;
	height: 100rpx;
	position: relative;
	top: 1100rpx;
}
</style>
